package com.example.generic;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class GenericTest {

    public static void main(String[] args) throws Exception {
        List<Integer> list = new ArrayList<Integer>();
        list.add(1);
        Method addMethod = list.getClass().getDeclaredMethod("add", Object.class);
        addMethod.invoke(list,"程序员老魏");
        System.out.println(list);

    }

}
